#include "SequenceViewWindow.h"


vkbrd::SequenceViewWindow::SequenceViewWindow( QWidget* _parent ) :
QDialog(_parent)
{
	ui.setupUi(this);

	fingerLabels << ui.labelFinger0 << ui.labelFinger1 << ui.labelFinger2
		<< ui.labelFinger3 << ui.labelFinger4 << ui.labelFinger5
		<< ui.labelFinger6 << ui.labelFinger7 << ui.labelFinger8
		<< ui.labelFinger9; 
}

void vkbrd::SequenceViewWindow::fingerStateChanged( int _gloveNum, BoolFingers _val )
{
	int fingerIndex = fingerCount * _gloveNum;
	for (int i = 0; i < fingerCount; ++i, ++fingerIndex)
	{
		if (_val(i))
			fingerLabels[fingerIndex]->setFrameShape(QLabel::WinPanel);
		else
			fingerLabels[fingerIndex]->setFrameShape(QLabel::NoFrame);
	}
}

void vkbrd::SequenceViewWindow::displaySequenceName( Sequence _seq, bool _start)
{
	ui.labelKey->setText(_start ? Sequence::vKeyNames[_seq.getAction()] : " ");
}
